import React from "react";
const Menu = () => {
    const [paths, setPaths] = React.useState('/')
    const location = React.Router.useLocation()
    const { pathname } = location

    const setRouteActive = (val:string) =>
    {
        setPaths(val);
        React.navigate(val)
    }

    React.useEffect(() => {
        setPaths(pathname)
    })

    return (
        <div className="footer">
            <React.UI.TabBar style={{width: '100%'}} activeKey={paths} onChange={(value:string) => setRouteActive(value)}>
                <React.UI.TabBar.Item  key="/" icon={<React.ICON.AppOutline />}  title="首页" />
                <React.UI.TabBar.Item key="/business/index" icon={<React.ICON.UserOutline />} title="我的" />
            </React.UI.TabBar>
        </div>
    )
}

export default Menu;